package qianting.news.wemedia.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qianting.news.apis.models.article.dtos.StatisticsDto;
import qianting.news.common.entity.State;
import qianting.news.wemedia.service.WmStatisticsService;

@Api(tags = "图文统计管理")
@RestController
@RequestMapping("/statistics")
public class WmStatisticsController {

    @Autowired
    private WmStatisticsService wmStatisticsService;

    @ApiOperation(value = "统计当前用户的被收藏,被点赞数")
    @GetMapping("/newsDimension")
    public State newsDimension(String beginDate, String endDate){
        return wmStatisticsService.newsDimension(beginDate,endDate);
    }

    @ApiOperation(value = "分页查询图文统计")
    @GetMapping("/newsPage")
    public State newsPage(StatisticsDto dto){
        return wmStatisticsService.newsPage(dto);
    }
}
